package com.benjaminwan.read.free.model.action

import com.benjaminwan.read.free.model.enums.ActionType
import com.benjaminwan.read.free.model.enums.Horizontal
import com.benjaminwan.read.free.model.enums.Vertical
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class MouseDragPage @JvmOverloads constructor(
    val xDirection: Horizontal = Horizontal.RIGHT,
    val yDirection: Vertical = Vertical.UP,
    val dxRange: IntRange = (150..150),
    val dyRange: IntRange = (5..10),
    val stepXRange: IntRange? = (1..1),
    val stepYRange: IntRange? = (1..1),
    override val actionType: ActionType = ActionType.MouseDragPage
) : Action() {
    override fun toString(): String {
        val stepX = if (stepXRange != null) "$stepXRange" else "Global"
        val stepY = if (stepYRange != null) "$stepYRange" else "Global"
        return "x距离:${dxRange}, y距离:${dyRange}, x方向:${xDirection.name}, y方向:${yDirection.name}, x步进:${stepX}, y步进:${stepY}"
    }
}